package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/url"
)

type Re struct {
	Code int
	Msg  string
	Data map[string]interface{}
}

func main() {

	//这个接口接受任何类型的请求
	resp, err := http.PostForm("https://api.dsxtfc.com/api/api-test", url.Values{"name": {"Jim Green"}, "password": {"123456"}})
	defer resp.Body.Close()
	if err != nil {
		fmt.Println("请求失败")
	}
	//把响应结果，转换成字符串
	body, err := ioutil.ReadAll(resp.Body)
	content := string(body)
	fmt.Println(content)

	re := Re{}
	json.Unmarshal(body, &re)
	fmt.Println(re)
}
